<!DOCTYPE html>
<!-- <html xmlns:th="http://www.thymeleaf.org"> -->
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title></title>
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
<link rel="stylesheet" href="../js/layui/css/layui.css">
<script src="../js/layui/layui.all.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/WebCalendar.js"></script>
<script type="text/javascript">
var tabobj;
	$(function (){
		$.ajax({
			url : "selUsersByUid",
			type : 'post',
			data : {},
			dataType : "json",
			success : function(res) {
					//alert(res.length);
				if (res.length > 0) {
					for ( var i = 0; i < res.length; i++) {
						//alert(res.aslist[i].askerName)
						$("#gzz").append("<option value='"+res[i].loginName+"'>"+ res[i].loginName+ "</option>");
					}
				}
			}
		})
	})
$(function (){
	nftseach();
	//location.reload();
})
	function nftseach(){
		//alert(1)
		var name = $("#name").val();
		var btime = $("#btime").val();
		var etime = $("#etime").val();
		var hfqk = $("#hfqk option:selected").val();
		var gzfx = $("#gzfx option:selected").val();
		var gzz = $("#gzz option:selected").val();
		
		 layui.use(['form','layer', 'table'], function(){
			 
			  var laydate = layui.laydate //日期
			  ,layer = layui.layer //弹层
			  ,table = layui.table //表格
			 ,form = layui.form;
			   if( btime !="" && etime != ""){
					  if(btime > etime || btime == etime){
					  	layer.msg("时间区间输入不规范，请重新输入");
					  	return;
					  }
					  	  
				  } 
				//执行渲染
				tabobj =  table.render({
				    elem: '#nettab',//指定原始表格元素选择器（推荐id选择器）
				    toolbar:"#netdiv"
				    ,url:"showAllByWhere"
				    ,method:'post',
				    page:true,
				    where:{
				    	studentName : name,
				    	btime : btime,
				    	etime : etime,
				    	followState : hfqk,
				    	followType : gzfx,
				    	uname : gzz
				    	
				    }
				   ,width:1700
				    ,height: 715 //容器高度
				    ,cols:  [[ //标题栏
				        {checkbox: true,}
				        ,{field: 'id', title: 'ID', width: 80}
				        ,{field: 'studentId', title: '学生ID', width: 80}
				        ,{field: 'studentName', title: '学生名', width: 100}
				        ,{field: 'followState', title: '回访情况', width: 100}
				        ,{field: 'createTime', title: '创建时间', width: 140}
				        ,{field: 'followType', title: '跟踪方式', width: 100}
				       // ,{field: 'lockTime', title: '锁定时间', width: 120}
				       /*  ,{field: 'userId', title: '跟踪者', width: 80,templet: function (d){
				        	return "<em>"+d.stu.loginName+"</em>"
				        }} */
				        ,{field: 'userId', title: '跟踪者ID', width: 100 }
				        ,{field: 'uname', title: '跟踪者名字', width: 100 }
				        ,{field: 'followTime', title: '跟踪时间', width: 140}
				        ,{field: 'nextFollowTime', title: '下次跟踪时间', width: 140}
				        
				        ,{field: 'content', title: '内容信息', width: 200}
				        ,{fixed: 'right', width:100, title: '操作',align:'center', toolbar: '#barDemo'}
				      ]]
				  });
		 })
		// location.reload()
	}
	
	 layui.use(['form','layer', 'table'], function(){
		 
		  var laydate = layui.laydate //日期
		  ,layer = layui.layer //弹层
		  ,table = layui.table //表格
		 ,form = layui.form;
		//监听工具条
		  table.on('tool(demo)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
		    var data = obj.data //获得当前行数据
		    ,layEvent = obj.event; //获得 lay-event 对应的值
				
		    var con = data.content;
		    if(con.length>25){
		    	con = con.substr(0, 25);
		    	con +=".....";
		    }else{
		    	con = con;
		    }
		
		    form.val("shform",data);
		    if(layEvent === 'show'){
		    	layer.alert(con, {icon: 6,title:"内容信息"});
		    	/* layer.open({
					title:'查看学生信息',
					area:['400px','500px'],
					//closeBtn:0,
					type:1,
					content:$("#shdiv"),
					end : function(){

		         		   // alert("你点击了右上角的X");
						$("#shdiv").hide();
		         		}
				}) */
		    }
		  })
	 })
	function shclosebtn(){
		 layer.closeAll();
		 $("#shdiv").hide();
	 }
</script>
<script type="text/html" id="barDemo">
	<a class="layui-btn layui-btn-xs" lay-event="show">查看</a>
</script>
</head>
<body>
<table id="nettab" lay-filter="demo"></table>
	<div id="netdiv" style="display: none;">
		<form class="layui-form"  id="seavhform">
			<div class="layui-form-item">
				<!--学生名称、跟踪者、跟踪开始时间、跟踪结束时间、回访情况、跟踪方式  -->
			<label class="layui-form-label">学生姓名</label>
			    <div class="layui-input-inline">
			      <input type="text"  id="name"  autocomplete="off"  placeholder="请输入学生姓名" class="layui-input">
			    </div>
			     <label class="layui-form-label">跟踪方式</label>
				    		<div class="layui-input-inline">
						      <select id="gzfx"  readonly="readonly">
						         <option value="">请选择</option>
						        <option value="面谈">面谈</option>
						        <option value="网络">网络</option>
						        <option value="电话">电话</option>
						        <option value="其他">其他</option>
						      </select>
    						</div>
			    <label class="layui-form-label">跟踪者</label>
				    		<div class="layui-input-inline">
						      <select id="gzz"  readonly="readonly">
						        <option value="">请选择</option>
						      </select>
    						</div>
			<div class="layui-form-item">
			   <div class="layui-inline">
				     <label class="layui-form-label">跟踪时间</label>
					      <div class="layui-input-inline" style="width: 100px;">
					        <input type="text" name="price_min" placeholder="yyyy-MM-dd" onfocus="SelectDate(this,'yyyy-MM-dd')" autocomplete="off" class="layui-input" id="btime">
					      </div>
					      <div class="layui-form-mid">-</div>
					      <div class="layui-input-inline" style="width: 100px;">
					        <input type="text" name="price_max" placeholder="yyyy-MM-dd"  onfocus="SelectDate(this,'yyyy-MM-dd')"  autocomplete="off" class="layui-input" id="etime">
					      </div>
    						<label class="layui-form-label">回访情况</label>
				    		<div class="layui-input-inline">
						      <select id="hfqk"  readonly="readonly">
						        <option value="">请选择</option>
						        <option value="思量">思量</option>
						        <option value="上门未报名">上门未报名</option>
						        <option value="报名未进班">报名未进班</option>
						        <option value="已进班">已进班</option>
						        <option value="其他">其他</option>
						      </select>
    						</div>
    				
    				<input type="button"  value="检索" class="layui-btn  layui-icon-search"  onclick="nftseach()">
    			</div>
    				 
    			
    		</div>
		</div>

		</form>
	</div>
	
	<!-- 查看窗体  -->
	<!-- <div id="shdiv" style="display: none;">
		<form class="layui-form"  id="shform" lay-filter="shform">
		<div class="layui-form-item">
			    <label class="layui-form-label">学生姓名</label>
			    <div class="layui-input-inline">
			     	 <input type="text" name="studentName" autocomplete="off" readonly="readonly"  class="layui-input">
			 	 </div>
 		 </div>
 		 <div class="layui-form-item">
			    <label class="layui-form-label">回访时间</label>
			    <div class="layui-input-inline">
			     	 <input type="text"  name="followTime" autocomplete="off" readonly="readonly"  class="layui-input">
			 	 </div>
 		 </div>
 		 		<div class="layui-form-item">
			    <label class="layui-form-label">回访情况</label>
			 	 <div class="layui-input-inline">
						    <input type="text"name="followState" autocomplete="off"    readonly="readonly"  class="layui-input">
    						</div>
 		 		</div>
				<div class="layui-form-item">
					    <label class="layui-form-label">跟踪方式</label>
				    		<div class="layui-input-inline">
						   <input type="text" name="followType" autocomplete="off"  readonly="readonly"  class="layui-input">
    						</div>
				</div>
				<div class="layui-form-item">
			    <label class="layui-form-label">下次跟踪时间</label>
			    <div class="layui-input-inline">
			     	<input type="text" name="nextFollowTime" autocomplete="off"  readonly="readonly"  class="layui-input">
			 	 </div>
 		 </div>
 		 	<div class="layui-form-item layui-form-text">
				    <label class="layui-form-label">内容</label>
				    <div class="layui-input-block">
				      <textarea name="content" placeholder="请输入内容" class="layui-textarea"></textarea>
				    </div>
				</div>
		<div class="layui-form-item">
		    <div class="layui-input-block">
		      <input type="button"  value="关闭" class="layui-btn"  onclick="shclosebtn()">
		    </div>
  		</div>
	    </form>
	</div> -->
</body>
</html>